package com.lc.afbx.activity;

import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.lc.afbx.R;
import com.lc.afbx.conn.Conn;
import com.lc.afbx.conn.GetApiSetAd;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.util.UtilToast;

/**
 * Created by Administrator on 2016/7/5.
 */
public class BannerDetailActivity extends BaseActivity implements View.OnClickListener {

    private WebView banner_detail_wv;
    private SimpleDraweeView banner_detail_iv;

    private GetApiSetAd getApiSetAd = new GetApiSetAd(new AsyCallBack<GetApiSetAd.Info>() {
        @Override
        public void onSuccess(String toast, int type, GetApiSetAd.Info info) throws Exception {

            banner_detail_iv.setImageURI(Uri.parse(info.data.picurl));
            banner_detail_wv.loadUrl(Conn.SERVICE + info.data.web);
        }

        @Override
        public void onFail(String toast, int type) throws Exception {

            UtilToast.show(context, toast);
        }
    });

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_banner_detail);

        banner_detail_wv = ((WebView) findViewById(R.id.banner_detail_wv));
        banner_detail_iv = ((SimpleDraweeView) findViewById(R.id.banner_detail_iv));

        getApiSetAd.id = getIntent().getStringExtra("bannerId");
        getApiSetAd.execute(this);


    }

    @Override
    public void onClick(View view) {


        switch (view.getId()) {

            case R.id.back:
                finish();
                return;


        }


    }


}
